package ch6.ex11;
 
import static ch6.print.Print.*;
import ch6.ex2.Cleanser2;

class DetergentDelegation{
	private Cleanser2 c = new Cleanser2();
	
	public void append(String a){
		c.append(a);
	}
	public void dulite(){
		c.dulite();
	}
	public void apply(){
		c.apply();
	}
	public void scrub(){
		append(" DetergentDelegation.scrub");
		c.scrub();
	}
	public void foam(){
		c.append(" foam()");
	}
	public String toString(){
		return c.toString();
	}
	public static void  main(String... args){
		DetergentDelegation d = new DetergentDelegation();
		d.dulite();
		d.apply();
		d.scrub();
		d.foam();
		println(d);
		println("Testing base class");
		Cleanser2.main(args);
	}
}

public class Delegation extends DetergentDelegation{
	public static void  main(String... args){
		DetergentDelegation.main(args);
	}
}
